package com.lh.music.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.List;

/**
 * Created by a on 2016/12/12.
 */

public class VPFTitleAdapter extends FragmentPagerAdapter {
    private List<Fragment> mData;
    private List<String>  title;
    public VPFTitleAdapter(FragmentManager fm) {
        super(fm);
    }

    public VPFTitleAdapter(FragmentManager fm, List<Fragment> mData) {
        super(fm);
        this.mData = mData;
    }

    public VPFTitleAdapter(FragmentManager fm, List<Fragment> mData, List<String> title) {
        super(fm);
        this.mData = mData;
        this.title = title;
    }

    @Override
    public Fragment getItem(int position) {
        return mData.get(position);
    }

    @Override
    public int getCount() {
        return mData.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return title.get(position);
    }


}
